package br.usp.ime.origami.foldcut.util;

import br.usp.ime.origami.foldcut.structures.winged.WingedFace;
import br.usp.ime.origami.model.Point;

public class TangentEdge implements MoleculeEdge
{
	
	private WingedFace internalFace;
	
	private WingedFace externalFace;
	
	private Point first;

	private Point second;

	private EdgeType type;

	public Point getStart()
	{
		return first;
	}

	public Point getEnd()
	{
		return second;
	}

	public TangentEdge(Point first, Point second)
	{
		super();
		this.first = first;
		this.second = second;
	}

	public EdgeType getType()
	{
		return this.type;
	}
	
	public void setType(EdgeType type)
	{
		this.type = type;
	}

	public WingedFace getExternalFace()
	{
		return externalFace;
	}

	public void setExternalFace(WingedFace externalFace)
	{
		this.externalFace = externalFace;
	}

	public WingedFace getInternalFace()
	{
		return internalFace;
	}

	public void setInternalFace(WingedFace internalFace)
	{
		this.internalFace = internalFace;
	}
	
	@Override
	public String toString()
	{
		return String.format("[Tangent %s-%s]", first, second);
	}
	
	@Override
	public boolean equals(Object obj)
	{
	
		TangentEdge e = (TangentEdge) obj;
		
		return (e.getStart().equals(getStart()) && e.getEnd().equals(getEnd()))
		|| (e.getStart().equals(getEnd()) && e.getEnd().equals(getStart()));
	}



}
